/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package group2assignone.ucm.manager;

import group2assignone.model.Airport;
import group2assignone.ucm.UCController;
import group2assignone.view.UITool;
import group2assignone.view.manager.EditAirportView;

/**
 * Use Case: Change UI to Edit Airport details                                 <br>
 * Pre-condition: Manager has clicked edit from an edit airport view.     <br>
 * Post-condition: Manager main UI is displayed.                            <br>
 * 1. system displays the edit airport details view                         <br>
 * 1.a) No selection made - Show error                                        <br>
 * @author group2                                                           <br>
 */

public class UCEditAirport implements UCController
{

    private EditAirportView view;

    public UCEditAirport(EditAirportView view)
    {
        this.view = view;
    }

    public void run() {

    //1. system displays the edit airport details view
        if (view.getSelectedRow() >= 0) {  //if have selection

            view.showEditPanel();

            //1.a) No selection made - Show error
        } else {
            UITool.displayError("Select an Airport to Edit!!!", view);
        }
    }
}
